Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Logs middleware #116

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Logs middleware #116

wants to merge 13 commits into from

Conversation

felipao-mx
Copy link
Member

implements a middleware that sends requests information to a log ingestion server (Logstash)

@codecov
Copy link

codecov bot commented Jul 19, 2022

Codecov Report

Merging #116 (20e025f) into main (79ff0fc) will not change coverage.
The diff coverage is 100.00%.

@@            Coverage Diff            @@
##              main      #116   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            8         9    +1     
  Lines          273       356   +83     
  Branches        48        65   +17     
=========================================
+ Hits           273       356   +83     
Flag Coverage Δ
unittests 100.00% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
fast_agave/middlewares/__init__.py 100.00% <100.00%> (ø)
fast_agave/middlewares/loggers.py 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us.


@pytest.fixture(autouse=True)
def patch_log_server_url(monkeypatch):
monkeypatch.setenv('LOGS_SERVER_URL', 'http://logs.com')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

que se quiere probar aquí?

async def dispatch(
self, request: Request, call_next: RequestResponseEndpoint
) -> Response:
if not os.environ.get('LOGS_SERVER_URL', ''):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

porque se manda a llamar dentro de la función y no como una variable global?

Copy link
Member

@pachCode pachCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Algunas observaciones

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants